<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>固定定位</title>
  <style>
    .box {
      width: 200px;
      height: 200px;
      background: #000;
      position: fixed;
      left: 100px;
      top: 100px;
    }

    body {
      height: 1000px;
    }
  </style>
</head>

<body>
  <div class="box"></div>
</body>

</html>